package com.chris.libs.devtools.x.v1.utils.widget;

import android.annotation.SuppressLint;
import android.content.Context;
import android.widget.ImageView;

import androidx.annotation.IdRes;

import com.chris.libs.devtools.x.v1.utils.GlideUtil;

import org.jetbrains.annotations.NotNull;

/**
 * @author Chris chan
 * Create on： 2025/9/13 10:38
 * Use for: TextView工具
 * Explain:
 */
public class ImageViewUtil {
    public static ImageView create(@NotNull Context context, @NotNull String url) {
        ImageView imageView = new ImageView(context);
        GlideUtil.load(context, url, imageView);
        return imageView;
    }

    public static ImageView of(@NotNull Context context, @NotNull String url) {
        return create(context, url);
    }

    @SuppressLint("ResourceType")
    public static ImageView create(@NotNull Context context, @IdRes int redId) {
        ImageView imageView = new ImageView(context);
        GlideUtil.load(context, redId, imageView);
        return imageView;
    }

    public static ImageView of(@NotNull Context context, @IdRes int redId) {
        return create(context, redId);
    }
}
